<template>
    <div style="margin-bottom: 0.75rem;margin-top: -0.75rem;">
		<div class="aui-list-item-arrow01 server_show"  v-if="sendNameArr && sendNameArr.length != 0" style="background-color: #fff2f2;padding: 0.2rem 0.5rem;">
	        <div style="margin-left: 15;text-align: left;" class="aui-list-item-arrow_2">
				<h4>[赠品]</h4>
				<dl>
					<dd  v-for="(item,index) in sendNameArr" :key="index">
						<font>{{item}}</font>   <!--赠品名称-->
						<!--<span>¥9.8×1</span>-->
					</dd>
				</dl>
			</div>
		</div>
    </div>
</template>
<script>

import {mapMutations,mapGetters} from 'vuex';
import {Toast} from "../../../utils/toast";
import axios from 'axios';
export default {
    props: {
    	sendOrder:{
    		type:Function,
    		default:function(){
    			return ()=>{}
    		}
    	}
    },
    data() {
        return {
           sendNameArr:[]
        }
    },
    computed: {
    	...mapGetters('zx',[
    		"getGiftSendArr"
    	]),
    },
    methods: {
    	...mapMutations('zx',[
    		
    	]),
    	  getSendNameArr(){
				 this.sendNameArr = [];
				 var arr = this.getGiftSendArr;
				 if(arr && arr.length){
				 	for(let i = 0; i < arr.length; i++){
//				 		console.log(arr[i],'礼包');
				 		if(arr[i] != null && arr[i].giftName){
				 			this.sendNameArr.push(arr[i].giftName);
				 		}
				 		if(arr[i] != null && arr[i].couponName){
				 			this.sendNameArr.push(arr[i].couponName);
				 		}
					}
				 }
	        },
    },
    components: {
      
    },
    created() {
		this.getSendNameArr();
    },
    beforeDestroy(){
    		
    },
    watch: {
		getGiftSendArr(newVal,oldVal){
        	this.getSendNameArr();
        }
    }

}
</script>

<style scoped="scoped">
	
</style>


